<include file="Public:header" />
<include file="Public:leftside" />
<style>
  .pagination a{display: block;float: left;border: 1px solid #eee;padding: 2px 4px;margin: 0 2px;}
  .pagination span{display: block;float: left;border: 1px solid #eee;padding: 2px 4px;margin: 0 2px;background: #65bd77;color: #fff;}
</style>
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i> <a href="/">首页</a> </li>
			<li><a href="javascript:;">广告管理</a></li>
	
		</ul>
	</div>
	<div class="page-content">
 
    <section class="panel-default m-b-sm" style="width: 100%;margin: 5px auto;">
        <div class="alert alert-info">
            <p>
              <i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
            </p>
            <p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>该页面可对商品广告添加修改操作。</p>
            
        </div>
     </section>
    <div class="listContent">

    	<div class="wrap js-check-wrap">
    <form class="well form-search" method="post" action="{:U('shop/sliderAD')}">
      广告状态： 
      <select name="ad_status" style="width: 120px;" data="{$status}">
        <option value="-1" >全部状态</option>  
        <option value="1" <eq name="status" value="1">selected</eq>>投放中</option>
        <option value="0" <eq name="status" value="0">selected</eq>>禁用</option>
      </select> &nbsp;&nbsp; 
      广告分类:     
       <select name="ad_type" style="width: 120px;" data="{$status}">
        <option value="-1" >全部</option>  
        <option value="1" <eq name="ad_type" value="1">selected</eq>>幻灯类</option>
        <option value="2" <eq name="ad_type" value="2">selected</eq>>商品类</option>
        <option value="3" <eq name="ad_type" value="3">selected</eq>>品牌类</option>
        <option value="4" <eq name="ad_type" value="4">selected</eq>>店铺类</option>
      </select> &nbsp;&nbsp;    
      关键字： 
      <input type="text" name="keywords" style="width: 200px;" value="{$keywords|default=''}" placeholder="请输入关键字...">
      <input type="submit" class="btn btn-primary btn-sm" value="搜索" />
      <a class="btn btn-danger btn-sm" href="{:U('shop/sliderAD')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form" action="{:U('shop/listorders')}">
      <div class="table-actions" style="margin: 10px 0;">
        <button type="submit" class="btn btn-sm btn-primary js-ajax-submit">排序</button>
       
        <a class="btn btn-sm btn-danger" href="{:U('shop/add_ad',array('ad_type'=>1))}">添加广告</a>
      </div>
      <table class="table table-hover table-bordered table-list">
        <thead>
          <tr>
            <th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
            <th width="50">排序</th>
            <th width="50">ID</th>
            <th>广告名称</th>
            <th>广告副类名</th>
            <th>首页显示</th>
            <th>广告类型</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <foreach name="adData" item="vo">
          <tr>
            <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.id}" title="ID:{$vo.id}"></td>
            <td><input name="listorders[{$vo.id}]" type="text" size="3" value="{$vo.listorder}" class="input input-order valid" aria-invalid="false"></td>
            <td>{$vo.id}</td>
            <td>{$vo.ad_name}</td>
            <td>{$vo.sub_name}</td>
            <td><php>if($vo['ad_home']==1){echo '是';}else{echo '否';}</php></td>
            <td>{$vo.ad_type_name}</td>
            <td><php>if($vo['ad_status']==1){echo '投放中';}else{echo '禁用';}</php></td>
            <td>
            <a href="{:U('shop/manageSliderAD',array('id'=>$vo['id'],'ad_name'=>$vo['ad_name']))}">管理广告</a>  | 
             <a href="{:U('shop/editAD',array('id'=>$vo['id']))}">编辑</a> | 
             <a href="{:U('shop/deleteAD',array('id'=>$vo['id']))}" class="js-ajax-delete" >删除</a></td>
          </tr>
          </foreach>
        </tbody>
        <tfoot>
          <tr>
            <th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
            <th width="50">排序</th>
            <th width="50">ID</th>
            <th>广告名称</th>
            <th>广告副类名</th>
            <th>首页显示</th>
            <th>广告类型</th>
            <th>状态</th>
            <th>操作</th>
          </tr>
        </tfoot>
      </table>
      <div class="pagination">{$page}</div>
    </form>
  </div>
    </div>
   </div>
</div>

<script>
//全局变量
    var GV = {
         DIMAUB: "/",
        JS_ROOT: "NewAdmin/js/",
        TOKEN: ""
    };
</script>
<script src="/NewAdmin/js/wind.js"></script>
<link href="/NewAdmin/js/artDialog/skins/default.css" rel="stylesheet" />
<script src="/NewAdmin/js/zhlmy.js"></script>
  
  <script>
    $(function() {

      $("#navcid_select").change(function() {
        $("#mainform").submit();
      });

    });
  </script>
<include file="Public:footer" />
